/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-06 15:05:46  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.bp.entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "WWYT_BP_WORK_SAFETY_AUDIT")
@SQLDelete(sql = "update WWYT_BP_WORK_SAFETY_AUDIT set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_BP_WORK_SAFETY_AUDIT set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class BpWorkSafetyAudit implements java.io.Serializable {

    // columns START
    // ID
    private java.lang.Long id;
    // 作业类型
    private java.lang.String type;
    // 作业ID
    private java.lang.Long workId;
    // 作业证编码
    private String workCode;
    // 动火初审人
    private java.lang.Long opFireFirstAuditUserId;
    // 状态
    private java.lang.Integer state;
    // 审核时间
    private java.util.Date auditTime;
    // 审核信息
    private java.lang.String auditMsg;
    // 审核人
    private Long auditUserId;

    // 创建人
    private java.lang.Long createBy;
    // 创建时间
    private java.util.Date createTime;
    // 更新人
    private java.lang.Long updateBy;
    // 更新时间
    private java.util.Date updateTime;
    // 删除标记
    private java.lang.String deleteFlag;
    // 组织机构代码
    private java.lang.String orgCode;
    // 租户
    private java.lang.Long tenentId;
    // columns END
    // 验收状态
    private Integer checkState;
    // 验收意见
    private String checkMsg;
    private Date checkTime;
    private Long checkUserId;

    public void setId(java.lang.Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public java.lang.Long getId() {
        return this.id;
    }

    @Column(name = "TYPE", length = 4)
    public java.lang.String getType() {
        return this.type;
    }

    public void setType(java.lang.String value) {
        this.type = value;
    }

    @Column(name = "WORK_CODE", length = 10)
    public String getWorkCode() {
        return workCode;
    }

    public void setWorkCode(String workCode) {
        this.workCode = workCode;
    }

    @Column(name = "WORK_ID")
    public java.lang.Long getWorkId() {
        return this.workId;
    }

    public void setWorkId(java.lang.Long value) {
        this.workId = value;
    }

    @Column(name = "OP_FIRE_FIRST_AUDIT_USER_ID")
    public java.lang.Long getOpFireFirstAuditUserId() {
        return this.opFireFirstAuditUserId;
    }

    public void setOpFireFirstAuditUserId(java.lang.Long value) {
        this.opFireFirstAuditUserId = value;
    }

    @Column(name = "STATE")
    public java.lang.Integer getState() {
        return this.state;
    }

    public void setState(java.lang.Integer value) {
        this.state = value;
    }

    @Column(name = "AUDIT_TIME")
    public java.util.Date getAuditTime() {
        return this.auditTime;
    }

    public void setAuditTime(java.util.Date value) {
        this.auditTime = value;
    }

    @Column(name = "AUDIT_MSG", length = 200)
    public java.lang.String getAuditMsg() {
        return this.auditMsg;
    }

    public void setAuditMsg(java.lang.String value) {
        this.auditMsg = value;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public java.lang.Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(java.lang.Long value) {
        this.createBy = value;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public java.lang.Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(java.lang.Long value) {
        this.updateBy = value;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public java.lang.String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(java.lang.String value) {
        this.deleteFlag = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public java.lang.String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(java.lang.String value) {
        this.orgCode = value;
    }

    @Column(name = "TENENT_ID")
    public java.lang.Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(java.lang.Long value) {
        this.tenentId = value;
    }

    @Column(name = "CHECK_STATE")
    public Integer getCheckState() {
        return checkState;
    }

    public void setCheckState(Integer checkState) {
        this.checkState = checkState;
    }

    @Column(name = "CHECK_MSG", length = 200)
    public String getCheckMsg() {
        return checkMsg;
    }

    public void setCheckMsg(String checkMsg) {
        this.checkMsg = checkMsg;
    }

    @Column(name = "CHECK_TIME")
    public Date getCheckTime() {
        return checkTime;
    }

    public void setCheckTime(Date checkTime) {
        this.checkTime = checkTime;
    }

    @Column(name = "CHECK_USER_ID")
    public Long getCheckUserId() {
        return checkUserId;
    }

    public void setCheckUserId(Long checkUserId) {
        this.checkUserId = checkUserId;
    }

    @Column(name = "AUDIT_USER_ID")
    public Long getAuditUserId() {
        return auditUserId;
    }

    public void setAuditUserId(Long auditUserId) {
        this.auditUserId = auditUserId;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("type", getType())
                .append("workId", getWorkId()).append("opFireFirstAuditUserId", getOpFireFirstAuditUserId())
                .append("state", getState()).append("auditTime", getAuditTime()).append("auditMsg", getAuditMsg())
                .append("createBy", getCreateBy()).append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime())
                .append("deleteFlag", getDeleteFlag()).append("orgCode", getOrgCode()).append("tenentId", getTenentId())
                .toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpWorkSafetyAudit == false)
            return false;
        if (this == obj)
            return true;
        BpWorkSafetyAudit other = (BpWorkSafetyAudit) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
